﻿layui.use(['layer','comment'], function () {
    var layer = layui.layer
        , $ = layui.$
        , comment = layui.comment;
    comment.CheckPermission();
    $("#add_database").click(function () {
        comment._ACP(ApiUrl.DataBase.CreateDatabase, {}, function (res) {
            if (res.success) {
                layer.msg("执行成功");
            } else {
                layer.msg(res.errorMsg);
            }
        })
    })

    $("#add_tables").click(function () {
        comment._ACP(ApiUrl.DataBase.CreateTables, {}, function (res) {
            if (res.success) {
                layer.msg("执行成功");
            } else {
                layer.msg(res.errorMsg);
            }
        })
    })

    $("#add_admin").click(function () {
        comment._ACP(ApiUrl.DataBase.CreateAdminUser, {}, function (res) {
            if (res.success) {
                layer.msg("执行成功");
            } else {
                layer.msg(res.errorMsg);
            }
        })
    })
});